﻿
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ECItemDetallarPanel.ascx.cs" 
Inherits="UILGestion.Control.ECItemDetallarPanel" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="cc1" %>
<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc2" %>

<script src="../Scripts/DividirRecurso.js" type="text/javascript"></script>
<script src="../Scripts/Util.js" type="text/javascript"></script>

           <asp:UpdatePanel ID="partirUpdatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
           
               <asp:Panel ID="Panel1" runat="server" CssClass="Heading secTitle AreaHeading ms-crm-List-Header " >
                Detallar Recurso
                </asp:Panel>

               <asp:Panel ID="Panel2" runat="server"  class="ms-crm-Form-Body" Height="350px" >
                 <input id="idEstructuraCostoPartir" type="hidden"  runat="server" />
                               <input id="idRecursoPartirList" type="hidden"  runat="server" />
                               <input id="idRecursoPartirObj" type="hidden"  runat="server" />
                               <input id="idEstructuraCosto" type="hidden"  runat="server" />
                               <input id="simbolMoneda" type="hidden"  runat="server" />
                               

                               
<table  width="900px" >
            <tr>
                    <td   width="600px">
                    <table  style="background-color:White">
                    <tr>
                    <td align="right">Codigo:</td>
                    <td width="500px" >
                        <asp:Label ID="codigoLabel" runat="server"  ></asp:Label>
                    </td>
                    </tr>
                    <tr>
                    <td align="right" width="100px">
                        Descripcion:</td>
                    <td width="500px">
                        <asp:Label ID="RecursotoLabel" runat="server"></asp:Label>
                    </td>
            </tr>
                    <tr>
                    <td  align="right">
                        Unidad:</td>
                    <td >
                        <asp:Label ID="UnidadLabel" runat="server"  ></asp:Label>
                    </td>
                    
                 
                </tr>

                    </table>
                        
                    
                    <td rowspan="3" valign="top">
                       <table class="PanelTotales">
                       <tr>
                        <td align="right" width="100px">
                        &nbsp; Total Recurso:</td>
                    <td align="right" width="100px">
                        <asp:Label ID="TotalRecursoLabel" runat="server"></asp:Label>
                    </td>
                       </tr>
                           <tr>
                               <td align="right" width="100px">
                                   Total detalle:</td>
                               <td align="right">
                                   <asp:Label ID="TotalDetalleLabel" runat="server"></asp:Label>
                               </td>
                           </tr>
                       <tr>
                       <td align="right" width="100px">
                           &nbsp;</td>
                    <td align="right">
                        &nbsp;</td>
                       
                       </tr>
                       </table> 
                        </td>
                 
                </tr>
              
            </table>
            
        <asp:Panel ID="Panel3" runat="server" Height="330px" ScrollBars="Vertical" BackColor="White" 
                       BorderColor="LightSteelBlue" BorderStyle="Solid" BorderWidth="1px"   >
              
                 
       <asp:GridView ID="itemGridView" 
       Runat="Server"  SkinID="GridView"
       AutoGenerateColumns="false" 
       DataKeyNames="idInternal"  
       ShowFooter = "True"       
     
>
 
                    <Columns>
                      <asp:TemplateField HeaderText="CODIGO" ItemStyle-Width="75px" HeaderStyle-Width="75px">
                          <ItemTemplate>
                              <asp:Label ID="codigoLabel" runat="server" BackColor="Transparent" 
                                  Text='<%# Eval("codigo")%>' > </asp:Label>
                          </ItemTemplate>
                          <EditItemTemplate>
                          <asp:Label ID="codigoLabel" runat="server" BackColor="Transparent" 
                                  Text='<%# Eval("codigo")%>' > </asp:Label>
                          </EditItemTemplate>
                          <FooterTemplate>
                             
                              <cc2:PostTextBox ID="codigoInsertTextBox" runat="server" BackColor="Transparent" 
                                  ReadOnly="true" Width="70px" />
                          </FooterTemplate>
                          
                      </asp:TemplateField>
                      <asp:TemplateField HeaderText="DESCRIPCION"  ItemStyle-Width="400px" HeaderStyle-Width="400px">
                          <ItemTemplate>
                              <asp:Label ID="descripcionLabel" runat="server" BackColor="Transparent" 
                                  Text='<%# Eval("descripcion")%>'> </asp:Label>
                          </ItemTemplate>
                            <EditItemTemplate>
                          <asp:Label ID="descripcionLabel" runat="server" BackColor="Transparent" 
                                  Text='<%# Eval("descripcion")%>'> </asp:Label>
                          </EditItemTemplate>

                          <FooterTemplate>
                              

                            <cc1:Input ID="descripcionInsertTextBox" runat="server"   backcolor="#DFE8F6" 
                                               DataType="List" method="GetRecursoDisponible"   onchange="javascript:validarDescripcionInsert(this);" 
                                              OnSelect="SelectInsumoXDescripcionDiv" Width="300px" />
                             <cc2:PostTextBox ID="descripcionInsertTextBox1" runat="server"  BackColor="Transparent"  
                                              ReadOnly="true" Width="0px" />
                                              
                          </FooterTemplate>
                      </asp:TemplateField>
                      <asp:TemplateField HeaderText="UNID." ItemStyle-Width="35px" HeaderStyle-Width="35px">
                          <ItemTemplate>
                              <asp:Label ID="unidad45Label" runat="server" BackColor="Transparent" 
                                  Text='<%# Eval("unidad")%>' Width="35px"> </asp:Label>
                          </ItemTemplate>
                          <EditItemTemplate>
                          <asp:Label ID="unidad45Label" runat="server" BackColor="Transparent" 
                                  Text='<%# Eval("unidad")%>' Width="35px"> </asp:Label>
                          </EditItemTemplate>

                          <FooterTemplate>
                             <cc2:PostTextBox ID="unidadInsertTextBox" runat="server" BackColor="Transparent"  
                                  ReadOnly="true" Width="35px" />

                                
                          </FooterTemplate>
                          
                      </asp:TemplateField>
                      <asp:TemplateField HeaderText="CANTIDAD" ItemStyle-Width="75px" HeaderStyle-Width="75px" ItemStyle-HorizontalAlign="Right" >
                          <ItemTemplate>
                              <div class="labelDecimal">
                                  <asp:Label ID="cantidadLabel" runat="server" BackColor="Transparent" 
                                      Text='<%# Eval("cantidadStr")%>'> </asp:Label>
                              </div>
                          </ItemTemplate>
                          <EditItemTemplate>
                         <%--<cc2:PostTextBox ID="cantidadDividirInsertTextBox" runat="server" BackColor="Transparent"  Width="80px" 
                                  onchange="javascript:calcularTotalXCantDividir(this);"  DataType="Double"
                                  />--%>
                          </EditItemTemplate>

                          <FooterTemplate>
                             <cc2:PostTextBox ID="cantidadDividirInsertTextBox" runat="server" BackColor="Transparent"  Width="75px" 
                                  onchange="javascript:calcularTotalXCantDividir(this);"  DataType="Double"
                                  />

                                    
                          </FooterTemplate>
                          <ItemStyle Width="45px" />
                      </asp:TemplateField>
                      <asp:TemplateField HeaderText="PRECIO" ItemStyle-Width="75px" ItemStyle-HorizontalAlign="Right">
                          <ItemTemplate>
                              <div class="labelDecimal">
                                  <asp:Label ID="precio2Label" runat="server" BackColor="Transparent" 
                                      Text='<%# Eval("precioStr")%>'> </asp:Label>
                              </div>
                          </ItemTemplate>
                          <FooterTemplate>
                              <cc2:PostTextBox ID="precioInsertTextBox" runat="server" BackColor="Transparent"  Width="75px" 
                                  onchange="javascript:calcularTotalXPrecioDividir(this);" DataType="Double"  />

                                 
                          </FooterTemplate>
                        
                      </asp:TemplateField>
                      <asp:TemplateField HeaderText="TOTAL" ItemStyle-Width="75px" ItemStyle-HorizontalAlign="Right">
                          <ItemTemplate>
                             
                                  <asp:Label ID="totalLabel" runat="server" BackColor="Transparent" 
                                      Text='<%# Eval("totalStr")%>' > </asp:Label>
                           
                          </ItemTemplate>
                          <FooterTemplate>
                              <table width="100%">
                                  <tr>
                                      <td>
                                          <b>Disp:</b></td>
                                      <td>
                                           <asp:Label ID="totalBaseInsertLabel" runat="server" BackColor="Transparent"  Width="100%" />
                                          </div>
                                      </td>
                                  </tr>
                              </table>
                             <cc2:PostTextBox ID="totalInsertTextBox" runat="server" BackColor="Transparent" 
                                  ReadOnly="true" TabIndex="3"   DataType="Double" />

                                   
                          </FooterTemplate>
                         
                      </asp:TemplateField>
                      <asp:TemplateField>
                          <ItemTemplate>

                        <asp:ImageButton ID="ImageButton1" runat="server" 
                                Width="15px"
                                OnClientClick="return confirm('Usted quiere eliminar?')" 
                                 CommandArgument='<%# Eval("idInternal")%>'  OnClick="DeleteItem" 
                                  ImageUrl="~/estilos/_imgs/delete.gif" />

                          
                          </ItemTemplate>
                          <FooterTemplate>
                          <asp:Button ID="btnAdd" runat="server" onclick="AddItem"  Text="Añadir"></asp:Button>
                          </FooterTemplate>
                      </asp:TemplateField>
                 
                 
                  </Columns>
                  </asp:GridView>
         </asp:Panel>  
</asp:Panel>
 
               
            </ContentTemplate>
           
            </asp:UpdatePanel>
          
    
          
    



          
    


